package com.springboot.redis.demo;

import redis.clients.jedis.Jedis;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Redis 客户端
 *
 * @author: zr
 * @date: 2021-11-17
 */
public class RedisClient {

    public static Jedis jedis;

    /**
     * Redis 客户端Ip地址
     */
    public static String host = "127.0.0.1";

    /**
     * Redis 客户端端口号
     */
    public static int port = 6379;

    static {
        jedis = new Jedis(host, port);
    }

    /**
     * 获取当前时间
     *
     * @param
     * @return {@link String}
     * @throws
     * @date 2021-11-17
     */
    public static String getCurrentDate() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String today = simpleDateFormat.format(new Date());
        return today;
    }
}
